from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from app.db.database import get_db
from app.models.question import Question

router = APIRouter()

@router.get("/questions")
def get_questions(
    subject: int,
    model: str,
    db: Session = Depends(get_db)
):
    """سوئاللار تىزىملىكىنى ئېلىش"""
    questions = db.query(Question)\
        .filter(Question.subject == subject)\
        .filter(Question.model == model)\
        .all()
    return questions
